import com.note.pojo.Comment;
import com.note.service.view.viewService;
import com.note.service.view.viewServiceImpl;
import org.junit.Test;

import java.sql.SQLException;
import java.util.List;

public class test1 {
    @Test
    public void te() throws SQLException {
        viewService v = new viewServiceImpl();
        List<Comment> allComments = v.getAllComments(1);
//        System.out.println(allComments.get(4).children.size());
//        String noteJson = JSON.toJSONString(allComments, true);
//        System.out.println(noteJson);
        for (Comment allComment : allComments) {
            System.out.println(allComment.getId()+" "+allComment.getContent()+" "+allComment.getParentId());
            for (Integer child : allComment.children) {
                System.out.print(child+" ");
            }
            System.out.println();
        }
    }
}
